package edu.gatech.oops.servlets;

import java.io.Serializable;

public class Team implements Serializable
{
	private String teamName;
	private String[] teamMembers;
	
	public Team(String teamName, int teamLimit)
	{
		this.teamName = teamName;
		teamMembers = new String[teamLimit];
	}
	
	public Team(int teamLimit)
	{
		this(null, teamLimit);
	}
	
	public boolean add(String name)
	{
		for(int i = 0; i < teamMembers.length; i++)
		{
			if(teamMembers[i] == null)
			{
				teamMembers[i] = name;
				return true;
			}
		}
		return false;
	}

	public String getTeamName() {
		return teamName;
	}

	public void setTeamName(String teamName) {
		this.teamName = teamName;
	}

	public String[] getTeamMembers() {
		return teamMembers;
	}

	public void setTeamMembers(String[] teamMembers) {
		this.teamMembers = teamMembers;
	}
	
	public String toString()
	{
		return teamName;
	}
	

}
